// Copyright (c) 2022 Presto Labs Pte. Ltd.
// Author: daniel

#pragma once

#include <string>

#include "coin2/exchange/base/order/external.h"

namespace coin2::exchange::base::order {

using ConversionSpec = coin::proto::ConversionSpec;

class SpecManager {
 public:
  static auto GenerateConversionSpec(
      const std::string& from_currency,
      const std::string& to_currency,
      double from_amount) -> ConversionSpec {
    ConversionSpec conversion_spec;
    conversion_spec.set_from_currency(from_currency);
    conversion_spec.set_to_currency(to_currency);
    conversion_spec.set_from_amount(from_amount);
    return conversion_spec;
  }
  static auto GenerateConversionSpec(
      const coin2::exchange::base::symbology::ICurrency& from_currency,
      const coin2::exchange::base::symbology::ICurrency& to_currency,
      double from_amount) -> ConversionSpec {
    return GenerateConversionSpec(
        from_currency.native_currency(),
        to_currency.native_currency(),
        from_amount);
  }
};

}  // namespace coin2::exchange::base::order

